<template>
  <div>
    <van-nav-bar title="订单提交" left-text="返回" left-arrow @click-left="onClickLeft" />
    <van-cell-group>
      <!-- <van-cell title="订单金额" value="999" /> -->
      <van-cell title="抢号" :value="form.gunNo+'号枪'" />
      <van-cell title="油号" :value="form.oilNo" />
    </van-cell-group>
    <div class="sub">
      <div class="sub_title" @click="handGoup">下一步</div>
    </div>
  </div>
</template>

<script>
import {homeDetails, subOread, getSecretCode} from '@/api/user.js'
export default {
  components: {},
  data() {
    return {
      form: {}
    }
  },
  mounted() {
    this.form = this.$route.query
  },
  methods: {
    async handGoup() {
      let authCode = (await subOread(this.form)).data.authCode
      var reg = new RegExp('#', 'g')
      let oilNo = this.form.oilNo.replace(reg, '')
      let href = `https://st.czb365.com/v3_prod/?pft=98643413&authCode=${authCode}&gasId=${this.form.gasId}&oilNo=${oilNo}&gunNo=${this.form.gunNo}`
      console.log(href, this.form)
      window.location.href = href
    },
    onClickLeft() {
      this.$router.go(-1)
    }
  }
}
</script>

<style lang="scss" scoped>
.sub {
  position: fixed;
  bottom: 0;
  width: 100%;
  padding: 10px 20px;
  border-top: 1px solid #eee;
  box-sizing: border-box;
  background-color: #fff;
  .sub_title {
    background-color: rgb(195, 0, 51);
    height: 40px;
    text-align: center;
    color: #fff;
    font-size: 16px;
    line-height: 40px;
  }
}
</style>
